package com.code.soulnetty.modbus.client.channel;

import com.code.soulnetty.modbus.client.channel.impl.NettySyncChannel;
import com.code.soulnetty.modbus.client.channel.impl.ProtocolChannel;
import com.code.soulnetty.modbus.client.service.ProtocolResponseService;
import io.netty.channel.Channel;

import java.net.SocketAddress;

/**
 * 同步netty通道工厂类 - 生产同步通道
 * @author lyf
 * @date 2022-12-17 15:13
 */
public class SyncNettyChannelFactory implements ChannelFactory {

    @Override
    public ProtocolChannel create(SocketAddress remoteSocketAddress, Channel channel, ProtocolResponseService responseService, int retryCount, long timeOut, long reqIntl) {
        return new NettySyncChannel(remoteSocketAddress, channel, responseService, retryCount, timeOut, reqIntl);
    }
}
